--背包物流回收区大小
data:extend(
    {
        {
            type = "technology",
            name = "logistic-robotics",
            icon_size = 256,
            icon_mipmaps = 4,
            icon = "__base__/graphics/technology/logistic-robotics.png",
            effects = {
                {
                    type = "unlock-recipe",
                    recipe = "roboport"
                },
                {
                    type = "unlock-recipe",
                    recipe = "logistic-chest-passive-provider"
                },
                {
                    type = "unlock-recipe",
                    recipe = "logistic-chest-storage"
                },
                {
                    type = "unlock-recipe",
                    recipe = "logistic-robot"
                },
                {
                    type = "character-logistic-requests",
                    modifier = true
                },
                {
                    type = "character-logistic-trash-slots",
                    modifier = 200
                }
            },
            prerequisites = {"robotics"},
            unit = {
                count = 250,
                ingredients = {
                    {"automation-science-pack", 1},
                    {"logistic-science-pack", 1},
                    {"chemical-science-pack", 1}
                },
                time = 30
            },
            order = "c-k-c"
        }
    }
)

--修理包修理速度
data:extend(
    {
        {
            type = "repair-tool",
            name = "repair-pack",
            icon = "__base__/graphics/icons/repair-pack.png",
            icon_size = 64,
            icon_mipmaps = 4,
            subgroup = "tool",
            order = "b[repair]-a[repair-pack]",
            --修理速度
            speed = 20000,
            durability = 300,
            --单格叠加
            stack_size = 9000
        }
    }
)

--人物背包大小、人物相关属性
local movement_triggers = require("prototypes.entity.movement-triggers")
data:extend(
    {
        {
            type = "character",
            name = "character",
            icon = "__core__/graphics/icons/entity/character.png",
            icon_size = 64,
            icon_mipmaps = 4,
            flags = {"placeable-off-grid", "breaths-air", "not-repairable", "not-on-map", "not-flammable"},
            --人物生命值
            max_health = 600000000,
            alert_when_damaged = false,
            --人物生命恢复速度
            healing_per_tick = 1000000,
            collision_box = {{-0.2, -0.2}, {0.2, 0.2}},
            --修改人物碰撞面积，人就可以在水上跑了
            -- collision_box = {{0, 0}, {0, 0}},
            selection_box = {{-0.4, -1.4}, {0.4, 0.2}},
            hit_visualization_box = {{-0.2, -1.1}, {0.2, 0.2}},
            sticker_box = {{-0.2, -1}, {0.2, 0}},
            crafting_categories = {"crafting"},
            mining_categories = {"basic-solid"},
            character_corpse = "character-corpse",
            --背包大小
            inventory_size = 200,
            build_distance = 1000000,
            drop_item_distance = 1000000,
            reach_distance = 1000000,
            item_pickup_distance = 1,
            loot_pickup_distance = 2,
            enter_vehicle_distance = 3,
            reach_resource_distance = 2.7,
            ticks_to_keep_gun = 600,
            ticks_to_keep_aiming_direction = 100,
            --ticks you need to wait after firing a weapon or taking damage to get out of combat and get healed
            ticks_to_stay_in_combat = 600,
            damage_hit_tint = {r = 1, g = 0, b = 0, a = 0},
            running_speed = 0.1,
            distance_per_frame = 0.13,
            maximum_corner_sliding_distance = 0.7,
            subgroup = "creatures",
            order = "a",
            eat = {
                {
                    filename = "__base__/sound/eat.ogg",
                    volume = 1
                }
            },
            heartbeat = {
                {
                    filename = "__base__/sound/heartbeat.ogg"
                }
            },
            tool_attack_result = {
                type = "direct",
                action_delivery = {
                    type = "instant",
                    target_effects = {
                        type = "damage",
                        damage = {amount = 1000000000, type = "physical"}
                    }
                }
            },
            animations = {
                {
                    idle = {
                        layers = {
                            character_animations.level1.idle,
                            character_animations.level1.idle_mask,
                            character_animations.level1.idle_shadow
                        }
                    },
                    idle_with_gun = {
                        layers = {
                            character_animations.level1.idle_gun,
                            character_animations.level1.idle_gun_mask,
                            character_animations.level1.idle_gun_shadow
                        }
                    },
                    mining_with_tool = {
                        layers = {
                            character_animations.level1.mining_tool,
                            character_animations.level1.mining_tool_mask,
                            character_animations.level1.mining_tool_shadow
                        }
                    },
                    running_with_gun = {
                        layers = {
                            character_animations.level1.running_gun,
                            character_animations.level1.running_gun_mask,
                            character_animations.level1.running_gun_shadow
                        }
                    },
                    flipped_shadow_running_with_gun = {
                        layers = {
                            character_animations.level1.running_gun_shadow_flipped
                        }
                    },
                    running = {
                        layers = {
                            character_animations.level1.running,
                            character_animations.level1.running_mask,
                            character_animations.level1.running_shadow
                        }
                    }
                },
                {
                    armors = {"light-armor", "heavy-armor"},
                    idle = {
                        layers = {
                            character_animations.level1.idle,
                            character_animations.level1.idle_mask,
                            character_animations.level2addon.idle,
                            character_animations.level2addon.idle_mask,
                            character_animations.level1.idle_shadow,
                            character_animations.level2addon.idle_shadow
                        }
                    },
                    idle_with_gun = {
                        layers = {
                            character_animations.level1.idle_gun,
                            character_animations.level1.idle_gun_mask,
                            character_animations.level2addon.idle_gun,
                            character_animations.level2addon.idle_gun_mask,
                            character_animations.level1.idle_gun_shadow,
                            character_animations.level2addon.idle_gun_shadow
                        }
                    },
                    mining_with_tool = {
                        layers = {
                            character_animations.level1.mining_tool,
                            character_animations.level1.mining_tool_mask,
                            character_animations.level2addon.mining_tool,
                            character_animations.level2addon.mining_tool_mask,
                            character_animations.level1.mining_tool_shadow,
                            character_animations.level2addon.mining_tool_shadow
                        }
                    },
                    running_with_gun = {
                        layers = {
                            character_animations.level1.running_gun,
                            character_animations.level1.running_gun_mask,
                            character_animations.level2addon.running_gun,
                            character_animations.level2addon.running_gun_mask,
                            character_animations.level1.running_gun_shadow,
                            character_animations.level2addon.running_gun_shadow
                        }
                    },
                    flipped_shadow_running_with_gun = {
                        layers = {
                            character_animations.level1.running_gun_shadow_flipped,
                            character_animations.level2addon.running_gun_shadow_flipped
                        }
                    },
                    running = {
                        layers = {
                            character_animations.level1.running,
                            character_animations.level1.running_mask,
                            character_animations.level2addon.running,
                            character_animations.level2addon.running_mask,
                            character_animations.level1.running_shadow,
                            character_animations.level2addon.running_shadow
                        }
                    }
                },
                {
                    armors = {"modular-armor", "power-armor", "power-armor-mk2"},
                    idle = {
                        layers = {
                            character_animations.level1.idle,
                            character_animations.level1.idle_mask,
                            character_animations.level3addon.idle,
                            character_animations.level3addon.idle_mask,
                            character_animations.level1.idle_shadow,
                            character_animations.level3addon.idle_shadow
                        }
                    },
                    idle_with_gun = {
                        layers = {
                            character_animations.level1.idle_gun,
                            character_animations.level1.idle_gun_mask,
                            character_animations.level3addon.idle_gun,
                            character_animations.level3addon.idle_gun_mask,
                            character_animations.level1.idle_gun_shadow,
                            character_animations.level3addon.idle_gun_shadow
                        }
                    },
                    mining_with_tool = {
                        layers = {
                            character_animations.level1.mining_tool,
                            character_animations.level1.mining_tool_mask,
                            character_animations.level3addon.mining_tool,
                            character_animations.level3addon.mining_tool_mask,
                            character_animations.level1.mining_tool_shadow,
                            character_animations.level3addon.mining_tool_shadow
                        }
                    },
                    running_with_gun = {
                        layers = {
                            character_animations.level1.running_gun,
                            character_animations.level1.running_gun_mask,
                            character_animations.level3addon.running_gun,
                            character_animations.level3addon.running_gun_mask,
                            character_animations.level1.running_gun_shadow,
                            character_animations.level3addon.running_gun_shadow
                        }
                    },
                    flipped_shadow_running_with_gun = {
                        layers = {
                            character_animations.level1.running_gun_shadow_flipped,
                            character_animations.level3addon.running_gun_shadow_flipped
                        }
                    },
                    running = {
                        layers = {
                            character_animations.level1.running,
                            character_animations.level1.running_mask,
                            character_animations.level3addon.running,
                            character_animations.level3addon.running_mask,
                            character_animations.level1.running_shadow,
                            character_animations.level3addon.running_shadow
                        }
                    }
                }
            },
            light = {
                {
                    minimum_darkness = 0.3,
                    intensity = 0.4,
                    size = 25,
                    color = {r = 1.0, g = 1.0, b = 1.0}
                },
                {
                    type = "oriented",
                    minimum_darkness = 0.3,
                    picture = {
                        filename = "__core__/graphics/light-cone.png",
                        priority = "extra-high",
                        flags = {"light"},
                        scale = 2,
                        width = 200,
                        height = 200
                    },
                    shift = {0, -13},
                    size = 2,
                    intensity = 0.6,
                    color = {r = 1.0, g = 1.0, b = 1.0}
                }
            },
            mining_speed = 0.5,
            mining_with_tool_particles_animation_positions = {19},
            running_sound_animation_positions = {5, 16},
            synced_footstep_particle_triggers = movement_triggers.character,
            footprint_particles = {
                {
                    tiles = {
                        "dry-dirt",
                        "dirt-1",
                        "dirt-2",
                        "dirt-3",
                        "dirt-4",
                        "dirt-5",
                        "dirt-6",
                        "dirt-7",
                        "sand-1",
                        "sand-2",
                        "sand-3",
                        "nuclear-ground",
                        "red-desert-0",
                        "red-desert-1",
                        "red-desert-2",
                        "red-desert-3"
                    },
                    particle_name = "character-footprint-particle"
                },
                -- no particle by default so that both (synced_)footstep_particle_triggers are consistently not defined for tiles by default
                {
                    tiles = {},
                    use_as_default = true,
                    particle_name = nil
                }
            },
            right_footprint_frames = {10, 21},
            left_footprint_frames = {5, 16}, --{ 5 },
            right_footprint_offset = {0.1, 0},
            left_footprint_offset = {-0.1, 0},
            water_reflection = {
                pictures = {
                    filename = "__base__/graphics/entity/character/character-reflection.png",
                    priority = "extra-high",
                    -- flags = { "linear-magnification", "not-compressed" },
                    -- default value: flags = { "terrain-effect-map" },
                    width = 13,
                    height = 19,
                    shift = util.by_pixel(0, 67 * 0.5),
                    scale = 5,
                    variation_count = 1
                },
                rotate = false,
                orientation_to_variation = false
            }
        }
    }
)

--能量装甲MK2
data:extend(
    {
        {
            type = "armor",
            name = "power-armor-mk2",
            icon = "__base__/graphics/icons/power-armor-mk2.png",
            icon_size = 64,
            icon_mipmaps = 4,
            --抗性
            resistances = {
                {
                    type = "physical",
                    decrease = 100,
                    percent = 100
                },
                {
                    type = "acid",
                    decrease = 100,
                    percent = 100
                },
                {
                    type = "explosion",
                    decrease = 100,
                    percent = 100
                },
                {
                    type = "fire",
                    decrease = 100,
                    percent = 100
                }
            },
            subgroup = "armor",
            order = "e[power-armor-mk2]",
            stack_size = 1,
            infinite = true,
            equipment_grid = "large-equipment-grid",
            inventory_size_bonus = 100,
            open_sound = {filename = "__base__/sound/armor-open.ogg", volume = 1},
            close_sound = {filename = "__base__/sound/armor-close.ogg", volume = 1}
        }
    }
)

--能量盾MK2
data:extend(
    {
        {
            type = "energy-shield-equipment",
            name = "energy-shield-mk2-equipment",
            sprite = {
                filename = "__base__/graphics/equipment/energy-shield-mk2-equipment.png",
                width = 64,
                height = 64,
                priority = "medium",
                hr_version = {
                    filename = "__base__/graphics/equipment/hr-energy-shield-mk2-equipment.png",
                    width = 128,
                    height = 128,
                    priority = "medium",
                    scale = 0.5
                }
            },
            shape = {
                width = 2,
                height = 2,
                type = "full"
            },
            max_shield_value = 6000000000,
            energy_source = {
                type = "electric",
                buffer_capacity = "180kW",
                input_flow_limit = "360GW",
                usage_priority = "primary-input"
            },
            energy_per_shield = "30GW",
            categories = {"armor"}
        }
    }
)

--背包激光防御模块
-- data:extend({
-- {
--     type = "active-defense-equipment",
--     name = "personal-laser-defense-equipment",
--     sprite =
--     {
--         filename = "__base__/graphics/equipment/personal-laser-defense-equipment.png",
--         width = 64,
--         height = 64,
--         priority = "medium",
--         hr_version = {
--         filename = "__base__/graphics/equipment/hr-personal-laser-defense-equipment.png",
--         width = 128,
--         height = 128,
--         priority = "medium",
--         scale = 0.5
--         }
--     },
--     shape =
--     {
--         width = 2,
--         height = 2,
--         type = "full"
--     },
--     energy_source =
--     {
--         type = "electric",
--         usage_priority = "secondary-input",
--         buffer_capacity = "220kJ"
--     },

--     attack_parameters =
--     {
--         type = "beam",
--         cooldown = 10,
--         range = 100,
--         --source_direction_count = 64,
--         --source_offset = {0, -3.423489 / 4},
--         damage_modifier = 6000000000,
--         ammo_type =
--         {
--         category = "laser",
--         energy_consumption = "50kJ",
--         action =
--         {
--             type = "direct",
--             action_delivery =
--             {
--             type = "beam",
--             beam = "laser-beam",
--             max_length = 15,
--             duration = 40,
--             source_offset = {0, -1.31439 }
--             }
--         }
--         }
--     },

--     automatic = true,
--     categories = {"armor"}
--     }
-- })

--闸门血量
data.raw["gate"]["gate"].max_health = 60000000

--外骨骼模块
data.raw["movement-bonus-equipment"]["exoskeleton-equipment"].movement_bonus = 1
-- data:extend(
--     {
--         {
--             type = "movement-bonus-equipment",
--             name = "exoskeleton-equipment",
--             sprite = {
--                 filename = "__base__/graphics/equipment/exoskeleton-equipment.png",
--                 width = 64,
--                 height = 128,
--                 priority = "medium",
--                 hr_version = {
--                     filename = "__base__/graphics/equipment/hr-exoskeleton-equipment.png",
--                     width = 128,
--                     height = 256,
--                     priority = "medium",
--                     scale = 0.5
--                 }
--             },
--             shape = {
--                 width = 2,
--                 height = 4,
--                 type = "full"
--             },
--             energy_source = {
--                 type = "electric",
--                 usage_priority = "secondary-input"
--             },
--             energy_consumption = "200kW",
--             movement_bonus = 12,
--             categories = {"armor"}
--         }
--     }
-- )
